package com.mezz.bones.im.logic.domain.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * <p>
 * IM单聊
 * </p>
 *
 * @author mezz
 * @since 2024-12-20
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName(value = "chat_private_message_record", autoResultMap = true)
@ApiModel(value="ChatMessagePrivate对象", description="IM单聊")
public class ChatPrivateMessageRecord implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private String id;

    @ApiModelProperty(value = "消息KEY")
    private String msgKey;

    @ApiModelProperty(value = "消息所属者")
    private String userId;

    @ApiModelProperty("用户端类型 1user-用户 srm-供应商 saas-平台端")
    private String userType;

    @ApiModelProperty(value = "消息对端用户ID")
    private String peerId;

    @ApiModelProperty("用户类型 user-用户 srm-供应商 saas-平台端 group-群组")
    private String peerType;

    /**
     * 客服业务 子母号 如果是还未分配客服的消息 用供应商ID替代
     * 非客服业务 -1
     */
    @ApiModelProperty("客服业务 子号(供应商、平台客服ID) 1母号(供应商、平台 主体信息 ID) 非客服业务 -1")
    private String relationId;

    /**
     *               userId     userType peerId peerType  relationId    relationType
     * 用户-用户       用户ID       user    对端用户ID  user    -1           -1
     * 用户-供应商客服  用户ID       user    供应商ID    srm     srm客服ID     0子号
     * 供应商客服-用户  srm客服ID    srm     用户ID      user    供应商ID      1母号
     * 用户-平台       用户ID       saas    saas客服ID  saas    saas客服ID   0子号
     * 平台-用户       saas客服ID   saas    用户ID      user    0           1母号
     */
    @ApiModelProperty("客服业务 0子号(供应商、平台客服信息) 1母号(供应商、平台 主体信息) 具体数值映射到relation_id 非客服业务 -1")
    private Integer relationType;

    @ApiModelProperty(value = "user_id peer_id按自然顺序组合 通过$符号连接")
    private String sessionId;

    @ApiModelProperty(value = "0发送方 1接收方")
    private Integer direction;

    @ApiModelProperty(value = "消息序列号")
    private String msgSeq;

    @ApiModelProperty(value = "消息类型(0普通用户消息 1系统消息)")
    private Integer msgType;

    /**
     * @see com.mezz.bones.im.common.enums.ContentTypeEnum
     */
    @ApiModelProperty(value = "内容类型(文本,音频，视频，自定义消息)")
    private String contentType;

    @ApiModelProperty(value = "消息所属者是否已撤回 0未 1已撤回")
    private Integer userRecalled;

    @ApiModelProperty(value = "消息所属者撤回时间")
    private Date userRecalledTime;

    @ApiModelProperty(value = "用户删除 1已删 0否")
    private Integer userDel;

    @ApiModelProperty(value = "用户删除时间")
    private Date userDelTime;

    @ApiModelProperty(value = "创建时间")
    private Date createTime;

    @ApiModelProperty(value = "更新时间")
    private Date updateTime;

    @ApiModelProperty(value = "系统删除人员")
    private String delBy;

    @ApiModelProperty(value = "系统删除时间")
    private Date delTime;

    @ApiModelProperty(value = "系统删除 1已删 0否")
    private Integer isDel;

}
